<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.nce.util.LoginUserUtil"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>报表生成</title>
		<link href="${ctx}/css/jehoo.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/css/colorbox.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
		<script src="${ctx}/js/jquery.form.js" type="text/javascript"></script>
		<script src="${ctx}/js/jquery.colorbox.js" type="text/javascript"></script>
		<script src="${ctx}/js/table.js" type="text/javascript"></script>
		<link type="text/css" href="${ctx}/css/ui.all.css" rel="stylesheet" />
	<script type="text/javascript" src="${ctx}/js/ui.core.js"></script>
	<script type="text/javascript" src="${ctx}/js/ui.datepicker.js"></script>
	<script type="text/javascript" src="${ctx}/js/ui.datepicker-zh_CN.js"></script>
	
		<script>
		
		function datePicker(pickerName,locale) {
			$(pickerName).datepicker($.datepicker.regional[locale]);
			$(pickerName).datepicker('option', 'changeMonth', true);//月份可调
			$(pickerName).datepicker('option', 'changeYear', true);//年份可调
		}
	
		$(document).ready(function() {
			$("#gen_report_form").ajaxForm(function() { 
        			$("#gen_report_btn").text("报表生成成功");
		   	   		
     		}); 
			
            
			datePicker('#sdate','zh_CN');
			datePicker('#edate','zh_CN');
			
		    $("#gen_report_btn").click(function() {//start
		    
		    	if ($('#sdate').val() == ''|| $('#edate').val() == '') {
				
			      alert('日期不能为空')
				  return false;
	        	}
		   	    $("#gen_report_form").submit();
		   	     $("#gen_report_btn").text("报表生成中...");
				return false;
			});	 //end 
	  		
		});
</script>
	</head>
	<body>
		<div id="body" align="center">
		为了保证您的查询性能，两次导出的时间间隔请保持在5分钟以上。 <br>
		我们将为您保留30天内导出的数据，便于您随时导出。 
		<form id="gen_report_form" action="${ctx}/s/search!export.action">
		<div class="report_form" >
		<table cellpadding="0" cellspacing="0">
		<tr><td>开始日期:</td><td><input type="text" id="sdate" name="sdate"/></td><td>结束日期:</td><td><input type="text" id="edate" name="edate"/></td></tr>	
		<tr>		
		<c:if test="${param.content=='news'}"><td>内容类型:</td><td>新闻<input type="hidden" value="news" name="content"/></td></c:if>
		<c:if test="${param.content=='bbsblog'}"><td>内容类型:</td><td>论坛<input type="hidden" value="bbsblog" name="content"/></td></c:if>
		<c:if test="${param.content=='mblog'}"><td>内容类型:</td><td>微博<input type="hidden" value="mblog" name="content"/></td></c:if>
		<c:if test="${param.content=='basenews'}"><td>内容类型:</td><td>全部<input type="hidden" value="basenews" name="content"/></td></c:if>
		<c:if test="${param.type=='content'}"><td>类型:</td><td>按内容搜索<input type="hidden" value="content" name="type"/></td></c:if>
		<c:if test="${param.type=='title'}"><td>类型:</td><td>按标题搜索<input type="hidden" value="title" name="type"/></td></c:if>
		</tr>	
		<tr><td>搜索词:</td><td>${param.words}<input type="hidden" value="${param.words}" name="words"/></td><td>当前用户:</td><td><%=LoginUserUtil.getUser().getLoginName()%></td></tr>
		</table>
			</a><div class="btn_menu"><a id="gen_report_btn" class="export_btn" target="_blank" href="${ctx}/s/search!exportNews.action">生成报表</a>
		<a class="export_btn"  href="${ctx}/s/search!reports.action">查看已生成报表</a></div>
		</div>
		</form>
		
		</div>
	</body>
</html>